<?php

/**
 * Libretarecoleccion filter form base class.
 *
 * @package    courier
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseLibretarecoleccionFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'lre_avecalle'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_residcasa'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_aptonumcasa'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_urbanizacion' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_ciudad'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_pais'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_codpostal'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_latitud'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_longitud'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_nomdireccion' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lre_cliente'      => new sfWidgetFormPropelChoice(array('model' => 'Cliente', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'lre_avecalle'     => new sfValidatorPass(array('required' => false)),
      'lre_residcasa'    => new sfValidatorPass(array('required' => false)),
      'lre_aptonumcasa'  => new sfValidatorPass(array('required' => false)),
      'lre_urbanizacion' => new sfValidatorPass(array('required' => false)),
      'lre_ciudad'       => new sfValidatorPass(array('required' => false)),
      'lre_pais'         => new sfValidatorPass(array('required' => false)),
      'lre_codpostal'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'lre_latitud'      => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'lre_longitud'     => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'lre_nomdireccion' => new sfValidatorPass(array('required' => false)),
      'lre_cliente'      => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Cliente', 'column' => 'cli_id')),
    ));

    $this->widgetSchema->setNameFormat('libretarecoleccion_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Libretarecoleccion';
  }

  public function getFields()
  {
    return array(
      'lre_id'           => 'Number',
      'lre_avecalle'     => 'Text',
      'lre_residcasa'    => 'Text',
      'lre_aptonumcasa'  => 'Text',
      'lre_urbanizacion' => 'Text',
      'lre_ciudad'       => 'Text',
      'lre_pais'         => 'Text',
      'lre_codpostal'    => 'Number',
      'lre_latitud'      => 'Number',
      'lre_longitud'     => 'Number',
      'lre_nomdireccion' => 'Text',
      'lre_cliente'      => 'ForeignKey',
    );
  }
}
